package main

import (
	"fmt"
	"gitee.com/yxd1990/golang-common/utils"
	"github.com/astaxie/beego"
)

func init() {
	jwtConfig := &utils.JwtConfig{}
	jwtConfig.Secret = []byte(beego.AppConfig.DefaultString("jwtSecret", "appletree"))
	jwtConfig.JwtDueTime = 7 * 24
	utils.InitJwt(jwtConfig)
}
func main() {
	// var cc []int = []int{1, 2}
	// var out int
	// err := collections.CollectionOne(cc, func(item interface{}) bool {
	// 	return item.(int) == 1
	// }, &out)
	// if err == nil {
	// 	fmt.Println(out)
	// }
	token, err := utils.LoginUtil.GenerateToken(&utils.LoginUser{Id:11})
	fmt.Println(err)
	fmt.Println(token)
	loginUser, err := utils.LoginUtil.GetLoginUserId(token)
	fmt.Println(err)
	fmt.Println(loginUser)
	//cc := make(map[string]interface{})
	//test1(cc)
	//fmt.Println(cc)
}

func test1(cc map[string]interface{}) {
	cc["aa"] = 12
}
